SHELL = /bin/sh

CXX_SOURCES = llt_router.cc llt_simple_route.cc
GEN_SOURCES = llt_router.hh llt_simple_route_gen.cc llt_simple_route.hh

PPF_SOURCES = router.lp
MAIN_SOURCE = simple_route.lp
ALL_SOURCES = $(PPF_SOURCES) $(MAIN_SOURCE) 

.SUFFIXES:
.SUFFIXES: .lp .cc .hh .o .ppa

TARGET_NAME = simple_route.ppa

LLT_ACTION = llt simple_route.lp

$(TARGET_NAME) : $(GEN_SOURCES) $(CXX_SOURCES)
	lpkg $(subst .lp,,$(ALL_SOURCES))

llt_router.hh : router.lp
	$(LLT_ACTION)

llt_simple_route_gen.cc : simple_route.lp
	$(LLT_ACTION)

.PHONY: clean all

all : $(TARGET_NAME)

clean :
	rm -rf *.ppa *.o $(GEN_SOURCES)
